Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: call MenuHandlers without reflection #983

Conversation

miurahr
Copy link
Member

@miurahr miurahr commented Mar 16, 2024

refactor MainWindowMenuHandler and MainWindowMenu not to use reflection to invoke action. Otherwise, we use Action interface appeared in Java 1.6.
OmegaT project have not used it, because lib-mnemonics does not support Action interface in previous versions.
Now lib-mnemonics library version 1.2 adds AbstractmnemonicsAction class that help application define Acton with mnemonics.

Pull request type

  • Other (describe below)
    refactor

Which ticket is resolved?

dev-ML https://sourceforge.net/p/omegat/mailman/message/58749145/

What does this PR change?

  • Replace MainWindowMenuHandler#braBrabrahActionperformed method with Action classes that extends with AbstractMnemonicAction class
  • Change BaseMainWindowMenu to use Action class to construct UI components.
  • Deprecated IMainMenu#invokeAction but calls Action in action class.

Other information

Implementation depends on lib-mnemonics enhancement

omegat-org/lib-mnemonics#8

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

@miurahr miurahr marked this pull request as ready for review May 3, 2024 05:27
@miurahr miurahr force-pushed the topic/miurahr/gui/main/menu-construct-with-properties-abstract-action branch from d0ed739 to e4248fe Compare May 3, 2024 08:35
@miurahr
Copy link
Member Author

miurahr commented May 3, 2024

rebased on current master.

This comment was marked as resolved.

@miurahr miurahr force-pushed the topic/miurahr/gui/main/menu-construct-with-properties-abstract-action branch from cb48713 to 80bf094 Compare May 3, 2024 09:20
@miurahr
Copy link
Member Author

miurahr commented May 3, 2024

Now ready for merge.

- refactor exit actions menus

Signed-off-by: Hiroshi Miura <[email protected]>
@miurahr miurahr force-pushed the topic/miurahr/gui/main/menu-construct-with-properties-abstract-action branch from 09ebd74 to 65a7db0 Compare May 25, 2024 00:51

This comment was marked as resolved.

@miurahr miurahr added this to the 6.1.0 (Require Java 11) milestone May 25, 2024
miurahr added 2 commits May 25, 2024 09:58
Signed-off-by: Hiroshi Miura <[email protected]>
@miurahr miurahr changed the title reafactor: use AbstractMnemonicsAction to define Menu handlers refactor: use AbstractMnemonicsAction to define Menu handlers May 25, 2024
@miurahr miurahr changed the title refactor: use AbstractMnemonicsAction to define Menu handlers refactor: define Menu handlers with Swing Action interface May 25, 2024
miurahr added 3 commits May 25, 2024 11:19
- set default implementation of invokeAction interface
  with nothing
- Remove deprecated method from test overrides

Signed-off-by: Hiroshi Miura <[email protected]>
Copy link

❌ Unit Tests, Quality checks, and Acceptance Tests failed.

Please look a Gradle Scan page for details:
https://gradle.com/s/bifb6dizkwxoi

@miurahr miurahr marked this pull request as draft May 25, 2024 05:17
@miurahr miurahr force-pushed the topic/miurahr/gui/main/menu-construct-with-properties-abstract-action branch from 74ac6c6 to cb53607 Compare May 25, 2024 06:12
Copy link

❌ Unit Tests, Quality checks, and Acceptance Tests failed.

Please look a Gradle Scan page for details:
https://gradle.com/s/xmj7gndd4cum2

Signed-off-by: Hiroshi Miura <[email protected]>
@miurahr miurahr marked this pull request as ready for review May 28, 2024 21:22
miurahr added 7 commits May 29, 2024 07:31
- Fix NPE: call parent frame in initalization
- move Handler common method to ProjectUICommands

Signed-off-by: Hiroshi Miura <[email protected]>
Copy link

❌ Unit Tests, Quality checks, and Acceptance Tests failed.

Please look a Gradle Scan page for details:
https://gradle.com/s/n3374345rdyse

Copy link

❌ Unit Tests, Quality checks, and Acceptance Tests failed.

Please look a Gradle Scan page for details:
https://gradle.com/s/uogbpjfkry3ay

Copy link

❌ Unit Tests, Quality checks, and Acceptance Tests failed.

Please look a Gradle Scan page for details:
https://gradle.com/s/qeyigm5swrthi

Copy link

github-actions bot commented Jun 1, 2024

❌ Unit Tests, Quality checks, and Acceptance Tests failed.

Please look a Gradle Scan page for details:
https://gradle.com/s/2tp3fehqcl4kg

Signed-off-by: Hiroshi Miura <[email protected]>
Copy link

github-actions bot commented Jun 1, 2024

❌ Unit Tests, Quality checks, and Acceptance Tests failed.

Please look a Gradle Scan page for details:
https://gradle.com/s/l5yec62s2opoo

Copy link

github-actions bot commented Jun 1, 2024

❌ Unit Tests, Quality checks, and Acceptance Tests failed.

Please look a Gradle Scan page for details:
https://gradle.com/s/l5mfywxdoscps

Copy link

github-actions bot commented Jun 1, 2024

❌ Unit Tests, Quality checks, and Acceptance Tests failed.

Please look a Gradle Scan page for details:
https://gradle.com/s/vyvcdjwq4uisg

Signed-off-by: Hiroshi Miura <[email protected]>
Copy link

github-actions bot commented Jun 1, 2024

❌ Unit Tests, Quality checks, and Acceptance Tests failed.

Please look a Gradle Scan page for details:
https://gradle.com/s/ii7pv3pkrhgvm

@miurahr miurahr changed the title refactor: define Menu handlers with Swing Action interface refactor: call MenuHandlers without reflection Jun 10, 2024
@miurahr miurahr closed this Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant